package com.gexiaobao.pigeon.ui.dialog

import android.content.Context
import android.view.View
import androidx.core.view.isVisible
import androidx.databinding.DataBindingUtil
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.databinding.DialogGradleLiveBinding
import com.gexiaobao.pigeon.viewmodel.DialogViewModel

/**
 * @Author      : hxw
 * @Date        : 2024/7/25 10:44
 * @Describe    :
 */
class RxDialogGradleLive(context: Context?, viewModel: DialogViewModel) : RxDialog(context!!) {

    private lateinit var binding: DialogGradleLiveBinding
    private var mViewModel: DialogViewModel

    init {
        this.mViewModel = viewModel
        initView()
    }

    private fun initView() {
        binding = DataBindingUtil.inflate(layoutInflater, R.layout.dialog_gradle_live, null, false)
        binding.viewModel = mViewModel
        setContentView(binding.root)

        binding.tvCancel.setOnClickListener {
            dismiss()
        }
    }

    fun setSureBtnHidden(isHidden: Boolean) {
        binding.tvSure.isVisible = isHidden
    }

    fun setSureListener(listener: View.OnClickListener?) {
        binding.tvSure.setOnClickListener(listener)
    }

    fun setHideVideo(isHide: Boolean) {
        binding.llHomingVideo.isVisible = isHide
    }

    fun setHidePicture(isHide: Boolean) {
        binding.llHomingPicture.isVisible = isHide
    }

    fun setHomingVideoListener(listener: View.OnClickListener?) {
        binding.llHomingVideo.setOnClickListener(listener)
    }

    fun setHomingPictureListener(listener: View.OnClickListener?) {
        binding.llHomingPicture.setOnClickListener(listener)
    }

    fun setToBloodListener(listener: View.OnClickListener?) {
        binding.llPigeonBlood.setOnClickListener(listener)
    }

    fun setHideBlood(isVisible: Boolean) {
        binding.llPigeonBlood.isVisible = isVisible
    }
//
//    fun setCancelListener(listener: View.OnClickListener?) {
//        cancelView.setOnClickListener(listener)
//    }

}